/*LICENSE_BEGIN
 * ******************************************************************
 * All original parts of SoccerScope2003 have copyright (2003) by
 * Team YowAI, represented by Mr. Shuhei Shiota
 * The Department of Creative Informatics
 * The Graduate School of Information Science and Technology
 * The University of Tokyo
 * 
 * Additional classes (except libraries in /lib) were developed by 
 * the Dainamite Robocup-Team of the DAI-Labor, TU-Berlin 
 * (www.dai-labor.de)
 * 
 * Extended/new classes/packages are:
 *   soccerscope.analyzer.LogfileAnalyzer
 *   soccerscope.daistatistic.*
 *   soccerscope.daistatistic.charts.*
 *   soccerscope.daistatistic.tools.*
 *   soccerscope.db.*
 *   soccerscope.dialog.*
 *   soccerscope.model.PlayerWorldModel
 *   soccerscope.model.SimplePlayer
 *   soccerscope.net.AgentConnector
 *   soccerscope.training.*
 *   soccerscope.training.conditions.*
 * ******************************************************************
LICENSE_END*/
package soccerscope;

import javax.swing.table.TableModel;

import soccerscope.file.LogFileReader;
import soccerscope.model.SceneSetMaker;
import soccerscope.model.WorldModel;
import soccerscope.util.GameAnalyzer;

public class Stat {
	public static void main(String args[]) {
		// init worldmodel
		WorldModel wm = WorldModel.getInstance();

		for (int k = 0; k < args.length; k++) {
			try {
				wm.clear();
				LogFileReader lfr = new LogFileReader(args[k]);
				SceneSetMaker ssm = new SceneSetMaker(lfr, wm.getSceneSet());
				ssm.start();
				ssm.join();
				System.err.println();
				TableModel tb = GameAnalyzer.getTableModel();
				// todo System.out.println(args[k]);
				for (int i = 1; i < tb.getColumnCount(); i++) {
					for (int j = 0; j < tb.getRowCount(); j++) {
						System.out.print(tb.getValueAt(j, i) + ", ");
					}
					System.out.println();
				}
			} catch (Exception ie) {
				System.err.println(ie);
			}
		}
	}
}
